﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

public static class RecommendDataMgr
{
    private static List<RecommendData> _RecommendDatas;
    private static string _ConfigPath = Application.streamingAssetsPath + "/GameInfo.txt";

    static RecommendDataMgr()
    {
        
        Init();
    }
    public static List<RecommendData> GetData()
    {
        return _RecommendDatas;
    }
    private static void Init()
    {
        _RecommendDatas = new List<RecommendData>();
        string[] gameInfos = File.ReadAllLines(_ConfigPath);
        int index = 0;
        foreach (var info in gameInfos)
        {
            if (string.IsNullOrEmpty(info))
            {
                continue;
            }
            string[] infos = info.Split('#');
            _RecommendDatas.Add(new RecommendData(infos[0], infos[1], index++));
        }
    }


}

